package com.handinfo.android.game;

import java.io.DataInputStream;
import java.io.IOException;

import com.handinfo.android.core.graphics.DWGraphics;
import com.handinfo.android.utils.Tools;

public class Task
{
	public String m_name = null;// 名字
	public String m_key = null;// key
	public byte m_status = 0;// 状态
	public int m_type = 0;// 类型
	public int m_lv = 0;// 等级
	public byte m_difficulty = 0;// 难度等级
	public String m_depict = null;// 描述
//	public String m_pathfinding_tip = null;//寻路提示
	public int m_exp = 0;// 奖励经验
	public long m_money = 0;// 奖励金钱数量

	public byte m_detail_size = 0;// 详细信息显示的长度

	public String[] m_propID = null;// 奖励道具key
	public int[] m_propCount = null;// 奖励道具数量
    public String[] m_propName = null;///道具的名字
    public short [] m_propIcon = null;///道具的名字
    
	public String[] m_renownID = null;// 奖励声望ID
	public int[] m_renownCount = null;// 奖励声望数量

	public String m_progress = null;// 任务进度信息
	public String m_tooltip = null;// 任务提示

	public boolean m_show_detail = false;// 是否显示详细信息

	public String m_npc_key = null;//关联NPC的KEY
	
	public final String[] TASK_STATUS = { "[未接]", "[未完]", "[完成]" };
	public final String[] TASK_NAME_COLOR_STR = {"F8EC89", "E73F3F", "00FF00"};
//	public Task()
//	{
//
//	}

	public void drawContent(DWGraphics g, int x, int y, int color)
	{
		g.setColor(color);
		g.drawString(m_name + "  " + TASK_STATUS[m_status], color, x, y, Tools.LEFT_TOP);
	}

	/**
	 * 读取一个任务
	 * @param dis
	 * @param task
	 * @throws IOException
	 */
	public void readTask(DataInputStream dis) throws IOException
	{
		m_name = dis.readUTF();
		m_type = dis.readInt();
		m_key = dis.readUTF();
		m_status = dis.readByte();
		m_lv = dis.readInt();
//		m_type = type;
//		m_tooltip = dis.readUTF();
		m_difficulty = dis.readByte();
		m_progress = dis.readUTF();
	}
	
	/**
	 * 读取一个任务
	 * @param dis
	 * @param task
	 * @throws IOException
	 */
	public void readTaskByKey(DataInputStream dis) throws IOException
	{
		m_name = dis.readUTF();
		m_key = dis.readUTF();
		m_status = dis.readByte();
		m_lv = dis.readInt();
//		m_type = type;
		m_difficulty = dis.readByte();
		m_npc_key = dis.readUTF();
		Tools.debugPrintln("-------task 2-----------");
	}

}
